package qq2564874169.tuaotuao.fx.context;

import java.util.regex.Pattern;

public class DefaultScopeSetting {
    public final String target;
    public final String scope;
    private Pattern pattern;

    public DefaultScopeSetting(String target, String scope) {
        this.scope = scope;
        this.target = target;
        String regex = target.replace(".", "\\.").replace("*", ".*");
        pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);

    }

    boolean matches(String className) {
        return pattern.matcher(className).matches();
    }
}
